package time.after.time.service.pro;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import time.after.time.dao.pro.CityDao;
import time.after.time.entity.pro.City;

/**
 * 
 * @author HuMing create in 2013-3-28
 */
@Component
@Transactional
public class CityManager {

	@Autowired
	private CityDao cityDao;	
	
	public List<City> getCitys()
	{
		 return cityDao.find("FROM City WHERE grade!='DISTRICT' ORDER BY id ASC");
	}
	public List<City> selectProvince(City city){
		 List<City> list=null;
	     City city2=cityDao.findUniqueBy("name", city.getName());
	     String hql2="FROM City WHERE p_id=?";
	     list=cityDao.find(hql2, city2.getId());
	    return list;
}
}
